<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@page import="dyyx.dto.*"%>
<%@page import="dyyx.util.*"%>
<%@page import="java.util.*"%>
<%@page import="org.apache.kafka.clients.admin.*"%>
<%@page import="org.apache.kafka.common.*"%>


<%

WebResult webResult = new WebResult();
KafkaViewWebUtil.getConsumerGroupDesc(request, webResult);

ConsumerGroupDescription consumerGroupDescription = webResult.consumerGroupDescription;
Collection<MemberDescription> members = null;

if(consumerGroupDescription!=null){
	members = consumerGroupDescription.members();
}

if(members==null){
	members = new ArrayList<MemberDescription>();
}

%>

<%@include file="/comm.jsp"%>



<hr>
<%=new Date() %> <br>
<%=webResult.msg %>

<hr>
groupId: <%=webResult.groupId %>  

&nbsp; &nbsp; &nbsp; 
<a href="offset.jsp?groupId=<%=webResult.groupId%>">viewOffset</a>

&nbsp; &nbsp; &nbsp; 

<a href="info.jsp">clusterSummaryInfo</a>


<br>

<%if(consumerGroupDescription==null){return;} %>


<hr>
<table>
  <tr>
    <td>groupId</td>
    <td><%=consumerGroupDescription.groupId()%></td>
  </tr>
  <tr>
    <td>isSimpleConsumerGroup</td>
    <td><%=consumerGroupDescription.isSimpleConsumerGroup()%></td>
  </tr>
  <tr>
    <td>state</td>
    <td><%=consumerGroupDescription.state()%></td>
  </tr>
  <tr>
    <td>coordinator</td>
    <td><%=consumerGroupDescription.coordinator()%></td>
  </tr>
   <tr>
    <td>partitionAssignor</td>
    <td><%=consumerGroupDescription.partitionAssignor()%></td>
  </tr> 

</table>

<hr>

<table>

<tr class='title'>

<td>memberId</td>
<td>clientId</td>
<td>host</td>
<td>assignment</td>


</tr>

<%for(MemberDescription item:members){ %>


<tr>

<td><%=item.consumerId() %></td>
<td><%=item.clientId() %></td>
<td><%=item.host()%></td>
<td><%=KafkaUtil.toTopicPartiotionString(item.assignment().topicPartitions(),"<br>")%></td>
</tr>

<%} %>


</table>



